import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '人员信息',
    align: 'center',
    dataIndex: 'personId_dictText'
  },
  {
    title: '登录名',
    align: 'center',
    dataIndex: 'userName'
  },
  {
    title: '真实姓名',
    align: 'left',
    dataIndex: 'realName'
  },
  {
    title: '昵称',
    align: 'center',
    dataIndex: 'nickName'
  },
  {
    title: '身份证号码',
    align: 'center',
    dataIndex: 'idCardNo'
  },
  {
    title: 'email',
    align: 'center',
    dataIndex: 'email'
  },
  {
    title: '联系电话',
    align: 'center',
    dataIndex: 'phone'
  },
  {
    title: '所属单位',
    align: 'center',
    dataIndex: 'companyId_dictText'
  },
  {
    title: '账户类型',
    align: 'center',
    dataIndex: 'accountType_dictText'
  },
  {
    title: '用户状态',
    align: 'center',
    dataIndex: 'status_dictText'
  },
  {
    title: '头像',
    align: 'center',
    dataIndex: 'avatar',
    customRender: render.renderImage,
  },
  {
    title: '附加信息',
    align: 'center',
    dataIndex: 'attach',
  },
  {
    title: '性别',
    align: 'center',
    dataIndex: 'gender_dictText'
  },
  {
    title: '生日',
    align: 'center',
    dataIndex: 'birthday',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text);
    },
  },
  {
    title: '排序',
    align: 'center',
    dataIndex: 'sort'
  },
];

// 高级查询数据
export const superQuerySchema = {
  personId: {title: '人员信息',order: 0,view: 'sel_search', type: 'string',dictTable: "base_person", dictCode: 'id', dictText: 'real_name',},
  userName: {title: '登录名',order: 1,view: 'text', type: 'string',},
  realName: {title: '真实姓名',order: 2,view: 'text', type: 'string',},
  nickName: {title: '昵称',order: 3,view: 'text', type: 'string',},
  idCardNo: {title: '身份证号码',order: 4,view: 'text', type: 'string',},
  email: {title: 'email',order: 5,view: 'text', type: 'string',},
  phone: {title: '联系电话',order: 6,view: 'text', type: 'string',},
  companyId: {title: '所属单位',order: 7,view: 'sel_search', type: 'string',dictTable: "base_company", dictCode: 'id', dictText: 'company_name',},
  accountType: {title: '账户类型',order: 8,view: 'number', type: 'number',dictCode: 'dict_account_type',},
  status: {title: '用户状态',order: 9,view: 'number', type: 'number',dictCode: 'dict_mobile_user_status',},
  avatar: {title: '头像',order: 10,view: 'image', type: 'string',},
  attach: {title: '附加信息',order: 11,view: 'file', type: 'string',},
  gender: {title: '性别',order: 12,view: 'radio', type: 'string',dictCode: 'sex',},
  birthday: {title: '生日',order: 13,view: 'date', type: 'string',},
  sort: {title: '排序',order: 14,view: 'number', type: 'number',},
};
